<!DOCTYPE html>
<html lang=en>
<head>
  <meta charset="utf-8">
  
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-transform" />
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="format-detection" content="telephone=no,email=no,adress=no">
  <!-- Color theme for statusbar -->
  <meta name="theme-color" content="#000000" />
  <!-- 强制页面在当前窗口以独立页面显示,防止别人在框架里调用页面 -->
  <meta http-equiv="window-target" content="_top" />
  
  
  <title>基础环境配置 | Hexo</title>
  <meta name="description" content="基本环境配置 1. 检查nvcc 2. 安装torch和vision（可忽略）   jetson nao其他配置 1. 更新镜像源 1.1. apt 1.2. pip 1.3. docker   2. 安装pytorch和torchvison 3. miniforge包管理(选) 3.1. miniforge简介 3.2. 安装miniforge 3.3. 安装pytorch、torchvisi">
<meta property="og:type" content="article">
<meta property="og:title" content="基础环境配置">
<meta property="og:url" content="https://gitee.com/yin-qiyu/myblog/2022/02/11/learn_jetson/1.Environment%20configuration/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="基本环境配置 1. 检查nvcc 2. 安装torch和vision（可忽略）   jetson nao其他配置 1. 更新镜像源 1.1. apt 1.2. pip 1.3. docker   2. 安装pytorch和torchvison 3. miniforge包管理(选) 3.1. miniforge简介 3.2. 安装miniforge 3.3. 安装pytorch、torchvisi">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220225161019891.png">
<meta property="og:image" content="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220223224621637.png">
<meta property="og:image" content="https://img2020.cnblogs.com/blog/1733978/202104/1733978-20210414172645876-1962676.png">
<meta property="og:image" content="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220222141236206.png">
<meta property="og:image" content="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220222141251282.png">
<meta property="og:image" content="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220222141306843.png">
<meta property="og:image" content="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220222141316874.png">
<meta property="og:image" content="https://img2020.cnblogs.com/blog/1733978/202104/1733978-20210414172645876-1962676.png">
<meta property="og:image" content="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220226195653355.png">
<meta property="og:image" content="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220222141336662.png">
<meta property="og:image" content="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220222141405289.png">
<meta property="og:image" content="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220222141420401.png">
<meta property="og:image" content="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220226204438666.png">
<meta property="og:image" content="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220222141452790.png">
<meta property="og:image" content="https://img-blog.csdnimg.cn/20200602124909227.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MzE4MTM1MA==,size_16,color_FFFFFF,t_70">
<meta property="og:image" content="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220226204943881.png">
<meta property="og:image" content="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220302182808960.png">
<meta property="og:image" content="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220312224805927.png">
<meta property="og:image" content="https://developer.nvidia.com/sites/default/files/akamai/deeplearning/tensorrt/trt-info.png">
<meta property="og:image" content="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220222141611316.png">
<meta property="og:image" content="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220312212555390.png">
<meta property="og:image" content="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220222141647174.png">
<meta property="og:image" content="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220222141654527.png">
<meta property="og:image" content="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220224143750683.png">
<meta property="og:image" content="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220224143905042.png">
<meta property="article:published_time" content="2022-02-11T14:09:42.000Z">
<meta property="article:modified_time" content="2023-07-13T15:33:23.997Z">
<meta property="article:author" content="John Doe">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220225161019891.png">
  <!-- Canonical links -->
  <link rel="canonical" href="https://gitee.com/yin-qiyu/myblog/2022/02/11/learn_jetson/1.Environment%20configuration/index.html">
  
    <link rel="alternate" href="/atom.xml" title="Hexo" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png" type="image/x-icon">
  
  
<link rel="stylesheet" href="/yin-qiyu/myblog/css/style.css">

  
  
  
  
<meta name="generator" content="Hexo 6.3.0"></head>


<body class="main-center" itemscope itemtype="http://schema.org/WebPage">
  <header class="header" itemscope itemtype="http://schema.org/WPHeader">
  <div class="slimContent">
    <div class="navbar-header">
      
      
      <div class="profile-block text-center">
        <a id="avatar" href="https://github.com/cofess" target="_blank">
          <img class="img-circle img-rotate" src="/yin-qiyu/myblog/images/avatar.jpg" width="200" height="200">
        </a>
        <h2 id="name" class="hidden-xs hidden-sm">昵称</h2>
        <h3 id="title" class="hidden-xs hidden-sm hidden-md">Web Developer &amp; Designer</h3>
        <small id="location" class="text-muted hidden-xs hidden-sm"><i class="icon icon-map-marker"></i> Shenzhen, China</small>
      </div>
      
      <div class="search" id="search-form-wrap">

    <form class="search-form sidebar-form">
        <div class="input-group">
            <input type="text" class="search-form-input form-control" placeholder="Search" />
            <span class="input-group-btn">
                <button type="submit" class="search-form-submit btn btn-flat" onclick="return false;"><i class="icon icon-search"></i></button>
            </span>
        </div>
    </form>
    <div class="ins-search">
  <div class="ins-search-mask"></div>
  <div class="ins-search-container">
    <div class="ins-input-wrapper">
      <input type="text" class="ins-search-input" placeholder="Type something..." x-webkit-speech />
      <button type="button" class="close ins-close ins-selectable" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
    </div>
    <div class="ins-section-wrapper">
      <div class="ins-section-container"></div>
    </div>
  </div>
</div>


</div>
      <button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target="#main-navbar" aria-controls="main-navbar" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
    </div>
    <nav id="main-navbar" class="collapse navbar-collapse" itemscope itemtype="http://schema.org/SiteNavigationElement" role="navigation">
      <ul class="nav navbar-nav main-nav ">
        
        
        <li class="menu-item menu-item-home">
          <a href="/yin-qiyu/myblog/.">
            
            <i class="icon icon-home-fill"></i>
            
            <span class="menu-title">Home</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-archives">
          <a href="/yin-qiyu/myblog/archives">
            
            <i class="icon icon-archives-fill"></i>
            
            <span class="menu-title">Archives</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-categories">
          <a href="/yin-qiyu/myblog/categories">
            
            <i class="icon icon-folder"></i>
            
            <span class="menu-title">Categories</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-tags">
          <a href="/yin-qiyu/myblog/tags">
            
            <i class="icon icon-tags"></i>
            
            <span class="menu-title">Tags</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-repository">
          <a href="/yin-qiyu/myblog/repository">
            
            <i class="icon icon-project"></i>
            
            <span class="menu-title">Repository</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-books">
          <a href="/yin-qiyu/myblog/books">
            
            <i class="icon icon-book-fill"></i>
            
            <span class="menu-title">Books</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-links">
          <a href="/yin-qiyu/myblog/links">
            
            <i class="icon icon-friendship"></i>
            
            <span class="menu-title">Links</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-about">
          <a href="/yin-qiyu/myblog/about">
            
            <i class="icon icon-cup-fill"></i>
            
            <span class="menu-title">About</span>
          </a>
        </li>
        
      </ul>
      
	
    <ul class="social-links">
    	
        <li><a href="https://github.com/cofess" target="_blank" title="Github" data-toggle=tooltip data-placement=top><i class="icon icon-github"></i></a></li>
        
        <li><a href="http://weibo.com/cofess" target="_blank" title="Weibo" data-toggle=tooltip data-placement=top><i class="icon icon-weibo"></i></a></li>
        
        <li><a href="https://twitter.com/iwebued" target="_blank" title="Twitter" data-toggle=tooltip data-placement=top><i class="icon icon-twitter"></i></a></li>
        
        <li><a href="https://www.behance.net/cofess" target="_blank" title="Behance" data-toggle=tooltip data-placement=top><i class="icon icon-behance"></i></a></li>
        
        <li><a href="/yin-qiyu/myblog/atom.xml" target="_blank" title="Rss" data-toggle=tooltip data-placement=top><i class="icon icon-rss"></i></a></li>
        
    </ul>

    </nav>
  </div>
</header>

  
    <aside class="sidebar" itemscope itemtype="http://schema.org/WPSideBar">
  <div class="slimContent">
    
      <div class="widget">
    <h3 class="widget-title">Board</h3>
    <div class="widget-body">
        <div id="board">
            <div class="content">
                <p>欢迎交流与分享经验!</p>
            </div>
        </div>
    </div>
</div>

    
      

    
      

    
      
    
      
  <div class="widget">
    <h3 class="widget-title">Archive</h3>
    <div class="widget-body">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/yin-qiyu/myblog/archives/2023/07/">July 2023</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/yin-qiyu/myblog/archives/2023/04/">April 2023</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/yin-qiyu/myblog/archives/2023/03/">March 2023</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/yin-qiyu/myblog/archives/2023/02/">February 2023</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/yin-qiyu/myblog/archives/2023/01/">January 2023</a><span class="archive-list-count">5</span></li><li class="archive-list-item"><a class="archive-list-link" href="/yin-qiyu/myblog/archives/2022/04/">April 2022</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/yin-qiyu/myblog/archives/2022/03/">March 2022</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/yin-qiyu/myblog/archives/2022/02/">February 2022</a><span class="archive-list-count">7</span></li></ul>
    </div>
  </div>


    
      
  <div class="widget">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget-body">
      <ul class="recent-post-list list-unstyled no-thumbnail">
        
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                
              </p>
              <p class="item-title">
                <a href="/yin-qiyu/myblog/2023/07/13/hello-world/" class="title">Hello World</a>
              </p>
              <p class="item-date">
                <time datetime="2023-07-13T14:49:10.957Z" itemprop="datePublished">2023-07-13</time>
              </p>
            </div>
          </li>
          
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                
              </p>
              <p class="item-title">
                <a href="/yin-qiyu/myblog/2023/04/04/FreeRTOS/lonely_binary/" class="title">(no title)</a>
              </p>
              <p class="item-date">
                <time datetime="2023-04-04T06:56:35.461Z" itemprop="datePublished">2023-04-04</time>
              </p>
            </div>
          </li>
          
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                
              </p>
              <p class="item-title">
                <a href="/yin-qiyu/myblog/2023/03/16/esp/esp-idf/issue/" class="title">(no title)</a>
              </p>
              <p class="item-date">
                <time datetime="2023-03-16T06:02:58.279Z" itemprop="datePublished">2023-03-16</time>
              </p>
            </div>
          </li>
          
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                
              </p>
              <p class="item-title">
                <a href="/yin-qiyu/myblog/2023/02/26/%E5%A2%A8%E6%B0%B4%E5%B1%8F/Untitled/" class="title">(no title)</a>
              </p>
              <p class="item-date">
                <time datetime="2023-02-25T17:10:25.099Z" itemprop="datePublished">2023-02-26</time>
              </p>
            </div>
          </li>
          
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                
              </p>
              <p class="item-title">
                <a href="/yin-qiyu/myblog/2023/02/02/%E5%A2%A8%E6%B0%B4%E5%B1%8F/epaper/" class="title">(no title)</a>
              </p>
              <p class="item-date">
                <time datetime="2023-02-02T05:54:50.611Z" itemprop="datePublished">2023-02-02</time>
              </p>
            </div>
          </li>
          
      </ul>
    </div>
  </div>
  

    
  </div>
</aside>

  
  
<main class="main" role="main">
  <div class="content">
  <article id="post-learn_jetson/1.Environment configuration" class="article article-type-post" itemscope itemtype="http://schema.org/BlogPosting">
    
    <div class="article-header">
      
        
  
    <h1 class="article-title" itemprop="name">
      基础环境配置
    </h1>
  

      
      <div class="article-meta">
        <span class="article-date">
    <i class="icon icon-calendar-check"></i>
	<a href="/yin-qiyu/myblog/2022/02/11/learn_jetson/1.Environment%20configuration/" class="article-date">
	  <time datetime="2022-02-11T14:09:42.000Z" itemprop="datePublished">2022-02-11</time>
	</a>
</span>
        
        

        

        <span class="post-comment"><i class="icon icon-comment"></i> <a href="/yin-qiyu/myblog/2022/02/11/learn_jetson/1.Environment%20configuration/#comments" class="article-comment-link">Comments</a></span>
        
      </div>
    </div>
    <div class="article-entry marked-body" itemprop="articleBody">
      
        <ul>
<li><a href="#%E5%9F%BA%E6%9C%AC%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE">基本环境配置</a><ul>
<li><a href="#1-%E6%A3%80%E6%9F%A5nvcc">1. 检查nvcc</a></li>
<li><a href="#2-%E5%AE%89%E8%A3%85torch%E5%92%8Cvision%E5%8F%AF%E5%BF%BD%E7%95%A5">2. 安装torch和vision（可忽略）</a></li>
</ul>
</li>
<li><a href="#jetson-nao%E5%85%B6%E4%BB%96%E9%85%8D%E7%BD%AE">jetson nao其他配置</a><ul>
<li><a href="#1-%E6%9B%B4%E6%96%B0%E9%95%9C%E5%83%8F%E6%BA%90">1. 更新镜像源</a><ul>
<li><a href="#11-apt">1.1. apt</a></li>
<li><a href="#12-pip">1.2. pip</a></li>
<li><a href="#13-docker">1.3. docker</a></li>
</ul>
</li>
<li><a href="#2-%E5%AE%89%E8%A3%85pytorch%E5%92%8Ctorchvison">2. 安装pytorch和torchvison</a></li>
<li><a href="#3-miniforge%E5%8C%85%E7%AE%A1%E7%90%86%E9%80%89">3. miniforge包管理(选)</a><ul>
<li><a href="#31-miniforge%E7%AE%80%E4%BB%8B">3.1. miniforge简介</a></li>
<li><a href="#32-%E5%AE%89%E8%A3%85miniforge">3.2. 安装miniforge</a></li>
<li><a href="#33-%E5%AE%89%E8%A3%85pytorchtorchvision">3.3. 安装pytorch、torchvision</a></li>
<li><a href="#34-%E5%AE%89%E8%A3%85%E6%96%B0%E7%9A%84%E8%99%9A%E6%8B%9F%E7%8E%AF%E5%A2%83">3.4. 安装新的虚拟环境</a></li>
<li><a href="#35-pytorch18">3.5. pytorch1.8</a></li>
<li><a href="#36-orchvision-v090">3.6. orchvision v0.9.0</a></li>
</ul>
</li>
<li><a href="#4-%E6%9F%A5%E7%9C%8Bjetson%E4%BF%A1%E6%81%AF-jtop">4. 查看jetson信息 （jtop）</a></li>
<li><a href="#5-%E9%A3%8E%E6%89%87%E8%87%AA%E5%8A%A8%E6%8E%A7%E5%88%B6">5. 风扇自动控制</a></li>
<li><a href="#6-%E5%A2%9E%E5%8A%A0swap%E5%88%86%E5%8C%BA%E5%A4%A7%E5%B0%8F">6. 增加Swap分区大小</a></li>
<li><a href="#7-nomachine%E8%99%9A%E6%8B%9F%E7%BD%91%E7%BB%9C%E6%8E%A7%E5%88%B6%E5%8F%B0">7. nomachine（虚拟网络控制台）</a></li>
<li><a href="#8-vnc%E8%99%9A%E6%8B%9F%E7%BD%91%E7%BB%9C%E6%8E%A7%E5%88%B6%E5%8F%B0">8. VNC（虚拟网络控制台）</a></li>
<li><a href="#9-tensort">9. TensoRT</a><ul>
<li><a href="#91-tensort%E4%BB%8B%E7%BB%8D">9.1. TensoRT介绍：</a></li>
<li><a href="#92-%E6%A3%80%E6%9F%A5%E8%87%AA%E5%B8%A6tensorrt%E7%8E%AF%E5%A2%83%E9%80%89">9.2. 检查自带TensorRT环境（选）</a></li>
<li><a href="#93-jetson-inference%E5%BA%93%E5%AE%89%E8%A3%85%E9%80%89">9.3. jetson inference库安装（选）</a></li>
</ul>
</li>
<li><a href="#10-%E5%AE%89%E8%A3%85jupyter%E5%92%8Cjetcam">10. 安装jupyter和jetcam</a></li>
<li><a href="#11-darknet%E6%A1%86%E6%9E%B6%E9%80%89">11. darknet框架（选）</a></li>
</ul>
</li>
<li><a href="#nvidia-jetson-nano-%E5%AE%89%E8%A3%85-gstreamer">Nvidia Jetson Nano 安装 GStreamer</a><ul>
<li><a href="#1-%E9%85%8D%E7%BD%AEgstreamer%E7%AE%A1%E9%81%93">1. 配置GStreamer管道</a></li>
</ul>
</li>
</ul>
<h1 id="基本环境配置"><a href="#基本环境配置" class="headerlink" title="基本环境配置"></a>基本环境配置</h1><h2 id="1-检查nvcc"><a href="#1-检查nvcc" class="headerlink" title="1. 检查nvcc"></a>1. 检查nvcc</h2><p>jetson nano是原装了CUDA的，但是需要用户导入环境变量（导入相关的路径）才可以使用，<strong>只有环境变量导入成功后</strong>，方可在命令行使用 <code>nvcc -V</code></p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo vim .bashrc</span><br></pre></td></tr></table></figure>

<p>在最后添加这三行</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#选择一个即可</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">export</span> CUDA_HOME=<span class="variable">$CUDA_HOME</span>:/usr/local/cuda</span><br><span class="line"><span class="built_in">export</span> LD_LIBRARY_PATH=/usr/local/cuda/lib64:<span class="variable">$LD_LIBRARY_PATH</span></span><br><span class="line"><span class="built_in">export</span> PATH=/usr/local/cuda/bin:<span class="variable">$PATH</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="built_in">export</span> PATH=/usr/local/cuda-10.2/bin<span class="variable">$&#123;PATH:+:<span class="variable">$&#123;PATH&#125;</span>&#125;</span></span><br><span class="line"><span class="built_in">export</span> LD_LIBRARY_PATH=/usr/local/cuda-10.2/lib64\</span><br><span class="line"><span class="variable">$&#123;LD_LIBRARY_PATH:+:<span class="variable">$&#123;LD_LIBRARY_PATH&#125;</span>&#125;</span></span><br><span class="line"></span><br></pre></td></tr></table></figure>

<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">保存后退出，执行 <span class="built_in">source</span> ~/.bashrc，使得环境变量生效。</span><br></pre></td></tr></table></figure>

<p>在命令行输入 <code>nvcc -V</code> 如果正常输出，说明CUDA路径配置成功</p>
<img src="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220225161019891.png" alt="image-20220225161019891" style="zoom:50%;" />



<h2 id="2-安装torch和vision（可忽略）"><a href="#2-安装torch和vision（可忽略）" class="headerlink" title="2. 安装torch和vision（可忽略）"></a>2. 安装torch和vision（可忽略）</h2><ul>
<li><a target="_blank" rel="noopener" href="https://forums.developer.nvidia.com/t/pytorch-for-jetson-version-1-9-0-now-available/72048">官网</a></li>
</ul>
<p><a target="_blank" rel="noopener" href="https://blog.csdn.net/weixin_43947712/article/details/115530913">参考资料</a></p>
<p>安装好后测试如图：</p>
<p><img src="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220223224621637.png" alt="image-20220223224621637"></p>
<p>安装pytorch，首先CUDA的步骤得过一下可以看到nvcc -V</p>
<p>安装pytorch跟CUDA的版本要对应</p>
<img src="https://img2020.cnblogs.com/blog/1733978/202104/1733978-20210414172645876-1962676.png" alt="img" style="zoom: 67%;" width="1000"/>

<p>网上找了个1.6.0的安装包通过winscp上传到jetson后离线安装下，该离线包可以到资料5、常用库和模型中获取</p>
<p>sudo pip3 install torch-1.6.0a0+b31f58d-cp36-cp36m-linux_aarch64.whl</p>
<p>sudo pip3 install torchvision</p>
<p>sudo pip install boto3</p>
<p>终端输入python3进入到python3的运行环境中测试下，import torch，我遇到的报错是ImportError:libopenblas.so.0:无法打开共享对象文件或目录，看了下这个教程:<a target="_blank" rel="noopener" href="https://www.cnpython.com/qa/77454">https://www.cnpython.com/qa/77454</a></p>
<p>尝试安装了OpenBlas系统库问题解决了</p>
<p>sudo apt-get install libopenblas-dev</p>
<p>到python环境中</p>
<p>import torch</p>
<p>print(torch.<strong>version</strong>)</p>
<p>查看安装的版本</p>
<img src="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220222141236206.png" alt="image-20220222141236206" width="500" />

<p>接下来继续在python3环境中测试下pytorch的功能</p>
<p><strong>from</strong> <strong>future</strong> <strong>import</strong> print_function</p>
<p><strong>import</strong> torch</p>
<p>x <strong>&#x3D;</strong> torch**.**rand(5, 3)</p>
<p><strong>print</strong>(x)</p>
<p>输出</p>
<p>tensor([[0.3380, 0.3845, 0.3217],</p>
<p>​    [0.8337, 0.9050, 0.2650],</p>
<p>​    [0.2979, 0.7141, 0.9069],</p>
<p>​    [0.1449, 0.1132, 0.1375],</p>
<p>​    [0.4675, 0.3947, 0.1426]])</p>
<p>另外，要检查你的GPU驱动程序和CUDA是否启用，并通过PyTorch访问，运行以下命令返回是否启用CUDA驱动程序</p>
<p><strong>import</strong> torch</p>
<p>torch.cuda.is_available()</p>
<p>测试完毕后接下来再安装torchvision,根官网介绍,pytorch1.6吻合的torch版本为0.7.0</p>
<img src="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220222141251282.png" alt="image-20220222141251282" width="500" style="zoom:50%;" />



<p>sudo apt-get install libjpeg-dev zlib1g-dev</p>
<p>git clone –branch v0.7.0 <a target="_blank" rel="noopener" href="https://github.com/pytorch/vision">https://github.com/pytorch/vision</a> torchvision</p>
<p>cd torchvision</p>
<p>export BUILD_VERSION&#x3D;0.7.0</p>
<p>sudo python3 setup.py install</p>
<p>注意:安装可能会确实一些文件，这个可以安装相应的文件来解决，例如笔者遇到的是确实一下三个文件所以按了一下三个包</p>
<img src="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220222141306843.png" alt="image-20220222141306843" width="1000" style="zoom:50%;" />

<p>sudo apt install libavcodec-dev</p>
<p>sudo apt install libavformat-dev</p>
<p>sudo apt install libswscale-dev</p>
<p>重新sudo python3 setup.py install</p>
<p>到python环境中输入下代码可以查看版本是否对应</p>
<p>import torchvision</p>
<p>print(torchvision.<strong>version</strong>)</p>
<img src="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220222141316874.png" alt="image-20220222141316874" width="500" style="zoom:50%;" />



<h1 id="jetson-nao其他配置"><a href="#jetson-nao其他配置" class="headerlink" title="jetson nao其他配置"></a>jetson nao其他配置</h1><h2 id="1-更新镜像源"><a href="#1-更新镜像源" class="headerlink" title="1. 更新镜像源"></a>1. 更新镜像源</h2><h3 id="1-1-apt"><a href="#1-1-apt" class="headerlink" title="1.1. apt"></a>1.1. apt</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo <span class="built_in">cp</span> /etc/apt/sources.list /etc/apt/sources.list.bak</span><br></pre></td></tr></table></figure>

<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo vim /etc/apt/sources.list.bak</span><br></pre></td></tr></table></figure>

<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">ggVG  全选</span><br><span class="line">dG		删除</span><br></pre></td></tr></table></figure>

<ul>
<li><strong>源：</strong></li>
</ul>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main multiverse restricted universe</span><br><span class="line">deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main multiverse restricted universe</span><br><span class="line">deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main multiverse restricted universe</span><br><span class="line">deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main multiverse restricted universe</span><br><span class="line">deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main multiverse restricted universe</span><br><span class="line">deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main multiverse restricted universe</span><br><span class="line">deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main multiverse restricted universe</span><br><span class="line">deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main multiverse restricted universe</span><br></pre></td></tr></table></figure>

<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt-get update 		//更新</span><br></pre></td></tr></table></figure>



<h3 id="1-2-pip"><a href="#1-2-pip" class="headerlink" title="1.2. pip"></a>1.2. pip</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt-get install python3-pip python3-dev</span><br></pre></td></tr></table></figure>

 <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt-get install python-pip python-dev</span><br></pre></td></tr></table></figure>



<ul>
<li><strong>pip换源</strong></li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">$ sudo <span class="built_in">mkdir</span> .pip		<span class="comment">#创建隐藏文件夹</span></span><br><span class="line">$ <span class="built_in">ls</span> -a  						<span class="comment">#查看所有文件</span></span><br><span class="line">$ <span class="built_in">cd</span> .pip						<span class="comment">#进入文件夹</span></span><br><span class="line">$ sudo <span class="built_in">touch</span> pip.conf</span><br><span class="line">$ sudo vim pip.conf</span><br></pre></td></tr></table></figure>

<ul>
<li><strong>源</strong>:</li>
</ul>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">[global]</span><br><span class="line">timeout = 6000</span><br><span class="line">index-url = http://pypi.doubanio.com/simple/</span><br><span class="line">trusted-host = pypi.doubanio.com</span><br></pre></td></tr></table></figure>



<h3 id="1-3-docker"><a href="#1-3-docker" class="headerlink" title="1.3. docker"></a>1.3. docker</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cat</span> /etc/issue  <span class="comment">#查看ubantu版本</span></span><br></pre></td></tr></table></figure>

<p>查看Ubuntu系统版本号</p>
<p>根据Ubuntu的版本号，配置相关的源镜像。跳转到源文件所在的目录</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cd</span>  /etc/apt/</span><br></pre></td></tr></table></figure>

<p>可以试用文件编辑工具打开sources.list文件</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo gedit /etc/apt/sources.list</span><br></pre></td></tr></table></figure>

<p>直接用以下内容替换 sources.list文件中的所有内容即可。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">deb https://mirrors.ustc.edu.cn/ubuntu-ports/ bionic main restricted universe multiverse</span><br><span class="line">deb https://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse</span><br><span class="line">deb https://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse</span><br><span class="line">deb https://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-security main restricted universe multiverse</span><br></pre></td></tr></table></figure>

<p>更新了源文件之后，保存退出</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt-get update</span><br></pre></td></tr></table></figure>





<h2 id="2-安装pytorch和torchvison"><a href="#2-安装pytorch和torchvison" class="headerlink" title="2. 安装pytorch和torchvison"></a>2. 安装pytorch和torchvison</h2><ul>
<li><p><a target="_blank" rel="noopener" href="https://forums.developer.nvidia.com/t/pytorch-for-jetson-version-1-10-now-available/72048">官网教程</a></p>
</li>
<li><p>版本要对应</p>
</li>
</ul>
<img src="https://img2020.cnblogs.com/blog/1733978/202104/1733978-20210414172645876-1962676.png" alt="img" style="zoom: 67%;" width="1000"/>

<ul>
<li><p>下载官方提供的<a target="_blank" rel="noopener" href="https://nvidia.box.com/shared/static/p57jwntv436lfrd78inwl7iml6p13fzh.whl">torch-1.8.0-cp36-cp36m-linux_aarch64.whl</a>包</p>
</li>
<li><p>按照官方教程输入以下命令</p>
</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">$ sudo apt-get install python3-pip libopenblas-base libopenmpi-dev</span><br><span class="line">$ pip3 install Cython</span><br><span class="line">$ pip3 install numpy torch-1.8.0-cp36-cp36m-linux_aarch64.whl <span class="comment"># (按照自己torch1.8.0包的下载路径修改，此过程较慢）</span></span><br><span class="line">$ sudo apt-get install libjpeg-dev zlib1g-dev libpython3-dev libavcodec-dev libavformat-dev libswscale-dev</span><br><span class="line">$ git <span class="built_in">clone</span> --branch v0.9.0 https://github.com/pytorch/vision torchvision</span><br><span class="line">$ <span class="built_in">cd</span> torchvision</span><br><span class="line">$ <span class="built_in">export</span> BUILD_VERSION=0.9.0</span><br><span class="line">$ python3 setup.py install --user <span class="comment">#时间较长</span></span><br></pre></td></tr></table></figure>

<ul>
<li>检查环境</li>
</ul>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">python3</span><br><span class="line"><span class="keyword">import</span> torch</span><br><span class="line"><span class="keyword">import</span> torchvision</span><br><span class="line"><span class="built_in">print</span>(torch.__version__)</span><br><span class="line"><span class="built_in">print</span>(torchvision.__version__)</span><br><span class="line">torch.cuda.is_available()</span><br></pre></td></tr></table></figure>



<img src="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220226195653355.png" alt="image-20220226195653355" style="zoom:50%;" />





<h2 id="3-miniforge包管理-选"><a href="#3-miniforge包管理-选" class="headerlink" title="3. miniforge包管理(选)"></a>3. miniforge包管理(选)</h2><p>:bangbang:<strong><font color='red'>此内容为可非必要配置，因为jetson是arm版本无法直接安装anaconda环境，如果需要在jetson上安装anaconda可以接着往下看，若不需要，请跳过</font></strong></p>
<h3 id="3-1-miniforge简介"><a href="#3-1-miniforge简介" class="headerlink" title="3.1. miniforge简介"></a>3.1. <a target="_blank" rel="noopener" href="https://github.com/conda-forge/miniforge/releases">miniforge简介</a></h3><p>conda是一个开源的包、环境管理器，可以用于在同一个机器上安装不同版本的软件包及其依赖，并能够在不同的环境之间切换。搞深度学习的应该都十分熟悉anaconda，但是NVIDIA Jetson Xavier NX是<strong>arm</strong>架构的，anaconda及其精简版miniconda并不支持arm64架构。现在主流的CPU架构分为Intel的x86&#x2F;x64架构和ARM的ARM&#x2F;ARM64两种，平常用的电脑大部分都是x86&#x2F;x64的（苹果除外），Xavier使用的是ARM64，所以很多在x86&#x2F;x64上能用的的东西到了它这里就不能用了。<strong>这一点请谨记，如果你在Jetson上遇到什么奇奇怪怪的例如“No such file or directory”之类的问题，第一时间要考虑是不是版本不是ARM64的版本</strong>。<br>在ARM64上的anaconda替代品是miniforge，miniforge与miniconda的区别在于miniforge的下载通道是conda-forge，其他基本没什么不同。</p>
<h3 id="3-2-安装miniforge"><a href="#3-2-安装miniforge" class="headerlink" title="3.2. 安装miniforge"></a>3.2. 安装miniforge</h3><ol>
<li><p>我下载的是 <code>Miniforge-pypy3-4.11.0-0-Linux-aarch64.sh</code>,,代表适用于arrch64架构下的Linux系统。（ARM64对应32位和64位分为arrch32和arrch64）</p>
</li>
<li><p>进入到miniforge的sh文件所在目录，右键打开Terminal，输入以下命令进行安装：</p>
</li>
</ol>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sh Miniforge-pypy3-4.10.3-3-Linux-aarch64.sh</span><br></pre></td></tr></table></figure>

<ol start="3">
<li>安装完毕后，添加环境变量，否则会出现<code>bash:conda Command not found</code>的错误。顺便提一下vim编辑器按a是进入编辑模式，编辑完毕后按ESC退出编辑模式，再输入:wq!是保存并退出。</li>
</ol>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 编辑环境变量</span></span><br><span class="line">vim ~/.bashrc</span><br><span class="line"><span class="comment"># 增加环境变量, 将&lt;username&gt;换成你的用户名</span></span><br><span class="line"><span class="built_in">export</span> PATH=/home/&lt;username&gt;/miniforge-pypy3/bin:<span class="variable">$PATH</span></span><br><span class="line"><span class="comment"># 激活环境变量</span></span><br><span class="line"><span class="built_in">source</span> ~/.bashrc</span><br><span class="line"><span class="comment"># 显示(base)</span></span><br><span class="line"><span class="built_in">source</span> activate</span><br></pre></td></tr></table></figure>

<ol start="4">
<li>更换清华源</li>
</ol>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">conda config --prepend channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/</span><br><span class="line">conda config --prepend channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/</span><br><span class="line">conda config --<span class="built_in">set</span> show_channel_urls <span class="built_in">yes</span></span><br></pre></td></tr></table></figure>





<h3 id="3-3-安装pytorch、torchvision"><a href="#3-3-安装pytorch、torchvision" class="headerlink" title="3.3. 安装pytorch、torchvision"></a>3.3. 安装pytorch、torchvision</h3><h3 id="3-4-安装新的虚拟环境"><a href="#3-4-安装新的虚拟环境" class="headerlink" title="3.4. 安装新的虚拟环境"></a>3.4. 安装新的虚拟环境</h3><ul>
<li>这是在minigorge上安装的pytorch，若不想在虚拟环境上安装。可以参考<a target="_blank" rel="noopener" href="https://forums.developer.nvidia.com/t/pytorch-for-jetson-version-1-10-now-available/72048">PyTorch for Jetson - version 1.10 now available - Jetson &amp; Embedded Systems &#x2F; Jetson Nano - NVIDIA Developer Forums</a></li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">conda create -n pytorch python=3.6	<span class="comment">#创建环境</span></span><br><span class="line">conda activate pytorch							<span class="comment">#激活环境</span></span><br><span class="line"></span><br></pre></td></tr></table></figure>



<ul>
<li>其他操作（看即可）</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">conda deactivate										<span class="comment">#退出环境</span></span><br><span class="line">conda remove -n pytorch --all</span><br><span class="line"></span><br><span class="line">conda info -e												<span class="comment">#查看已有环境</span></span><br></pre></td></tr></table></figure>





<p>激活成功会换名字</p>
<img src="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220222141336662.png" alt="image-20220222141336662" width="1000" style="zoom:50%;" />



<h3 id="3-5-pytorch1-8"><a href="#3-5-pytorch1-8" class="headerlink" title="3.5. pytorch1.8"></a>3.5. pytorch1.8</h3><p>直接输入命令安装PyTorch，<code>pip3</code>是python3的pip，如果没装，就换成<code>pip</code>。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">pip3 install -U future psutil dataclasses typing-extensions pyyaml tqdm seaborn</span><br><span class="line">wget https://nvidia.box.com/shared/static/p57jwntv436lfrd78inwl7iml6p13fzh.whl -O torch-1.8.0-cp36-cp36m-linux_aarch64.whl</span><br><span class="line">pip3 install torch-1.8.0-cp36-cp36m-linux_aarch64.whl</span><br></pre></td></tr></table></figure>

<p>如果网络不好的话，也可以先把PyTorch的whl文件下载下来，NVIDIA官方网址是：<a target="_blank" rel="noopener" href="https://forums.developer.nvidia.com/t/pytorch-for-jetson-version-1-9-0-now-available/72048">https://forums.developer.nvidia.com/t/pytorch-for-jetson-version-1-9-0-now-available/72048</a></p>
<ul>
<li><strong>&#x3D;&#x3D;<font color='red'>issue:</font>&#x3D;&#x3D;</strong></li>
</ul>
<p>如果出现<code>Illegal instruction (core dumped)</code>的错误，这是由于numpy 1.19.5和OpenBLAS冲突引起的，修改其中一项即可。选择以下两种做法之一：<br>（1）降低numpy版本</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pip3 install -U <span class="string">&quot;numpy==1.19.4&quot;</span></span><br></pre></td></tr></table></figure>

<p>(2)设置OpenBLAS</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">vim ~/.bashrc</span><br></pre></td></tr></table></figure>

<p>加入</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">export</span> OPENBLAS_CORETYPE=ARMV8</span><br></pre></td></tr></table></figure>

<p>然后激活.bashrc</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">source</span> ~/.bashrc</span><br></pre></td></tr></table></figure>



<h3 id="3-6-orchvision-v0-9-0"><a href="#3-6-orchvision-v0-9-0" class="headerlink" title="3.6. orchvision v0.9.0"></a>3.6. orchvision v0.9.0</h3><h2 id="4-查看jetson信息-（jtop）"><a href="#4-查看jetson信息-（jtop）" class="headerlink" title="4. 查看jetson信息 （jtop）"></a>4. 查看jetson信息 （jtop）</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">sudo pip3 install jetson-stats</span><br><span class="line">sudo jtop</span><br></pre></td></tr></table></figure>





<h2 id="5-风扇自动控制"><a href="#5-风扇自动控制" class="headerlink" title="5. 风扇自动控制"></a>5. <a target="_blank" rel="noopener" href="https://github.com/Pyrestone/jetson-fan-ctl.git">风扇自动控制</a></h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git <span class="built_in">clone</span> https://gitee.com/yin-qiyu/jetson-fan-ctl.git</span><br></pre></td></tr></table></figure>

<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cd</span> /jetson-fan-ctl <span class="comment">#进入文件夹</span></span><br></pre></td></tr></table></figure>

<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt install python3-dev</span><br></pre></td></tr></table></figure>

<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo ./install.sh</span><br></pre></td></tr></table></figure>

<p>现在你的风扇就可以按照温度自动调整运行速度了<br>风扇的一些设置在<code>/etc/automagic-fan/config.json</code>目录下。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">vim /etc/automagic-fan/config.json</span><br></pre></td></tr></table></figure>

<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">&#123;undefined</span><br><span class="line">“FAN_OFF_TEMP”:20,</span><br><span class="line">“FAN_MAX_TEMP”:50,</span><br><span class="line">“UPDATE_INTERVAL”:2,</span><br><span class="line">“MAX_PERF”:1</span><br><span class="line">&#125;</span><br><span class="line">~</span><br><span class="line">~</span><br></pre></td></tr></table></figure>



<h2 id="6-增加Swap分区大小"><a href="#6-增加Swap分区大小" class="headerlink" title="6. 增加Swap分区大小"></a>6. 增加Swap分区大小</h2><ul>
<li>先查看初试交换分区大小：</li>
</ul>
<img src="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220222141405289.png" alt="image-20220222141405289" width="800" />

<ul>
<li>生成swapfile文件操作如下</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#1）新增swapfile文件大小自定义</span></span><br><span class="line">sudo fallocate -l 6G /var/swapfile</span><br><span class="line"><span class="comment">#2）配置该文件的权限</span></span><br><span class="line">sudo <span class="built_in">chmod</span> 600 /var/swapfile</span><br><span class="line"><span class="comment">#3）建立交换分区</span></span><br><span class="line">sudo mkswap /var/swapfile</span><br><span class="line"><span class="comment">#4）启用交换分区</span></span><br><span class="line">sudo swapon /var/swapfile</span><br></pre></td></tr></table></figure>

<ul>
<li>设置为自动启用swapfile</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo bash -c <span class="string">&#x27;echo &quot;/var/swapfile swap swap defaults 0 0&quot; &gt;&gt; /etc/fstab&#x27;</span></span><br></pre></td></tr></table></figure>

<p>设置成功后：</p>
<img src="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220222141420401.png" alt="image-20220222141420401" width="1000" />





<h2 id="7-nomachine（虚拟网络控制台）"><a href="#7-nomachine（虚拟网络控制台）" class="headerlink" title="7. nomachine（虚拟网络控制台）"></a>7. nomachine（虚拟网络控制台）</h2><p>官网：<a target="_blank" rel="noopener" href="https://www.nomachine.com/">NoMachine - Free Remote Desktop For Everybody</a></p>
<ul>
<li><p>主机上正常安装</p>
</li>
<li><p>jetson上</p>
<ul>
<li><p>下载好对应版本用SFTP传到jetson</p>
</li>
<li><pre><code class="bash">sudo dpkg -i nomachine_7.6.2_3_arm64.deb
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">- 在同一局域网下即可连接</span><br><span class="line"></span><br><span class="line">&lt;img src=&quot;https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220403144934094.png&quot; alt=&quot;image-20220403144934094&quot; width=&quot;500&quot; /&gt;</span><br><span class="line"></span><br><span class="line">&lt;img src=&quot;https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220403145033336.png&quot; alt=&quot;image-20220403145033336&quot; width=&quot;500&quot; /&gt;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">## 8. VNC（虚拟网络控制台）</span><br><span class="line"></span><br><span class="line">- 编辑文件</span><br><span class="line"></span><br><span class="line">```bash</span><br><span class="line">sudo vim /usr/share/glib-2.0/schemas/org.gnome.Vino.gschema.xml</span><br></pre></td></tr></table></figure>
</code></pre>
</li>
</ul>
</li>
<li><p>滑到文末添加下段内容格式如图片所示</p>
</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">&lt;key name=<span class="string">&quot;enabled&quot;</span> <span class="built_in">type</span>=<span class="string">&quot;b&quot;</span>&gt;</span><br><span class="line">   &lt;summary&gt;Enable remote access to the desktop&lt;/summary&gt;</span><br><span class="line">   &lt;description&gt;</span><br><span class="line">    If <span class="literal">true</span>, allows remote access to the desktop via the RFB</span><br><span class="line">    protocol. Users on remote machines may <span class="keyword">then</span> connect to the</span><br><span class="line">    desktop using a VNC viewer.</span><br><span class="line">   &lt;/description&gt;</span><br><span class="line">   &lt;default&gt;<span class="literal">false</span>&lt;/default&gt;</span><br><span class="line">  &lt;/key&gt;</span><br></pre></td></tr></table></figure>

<img src="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220226204438666.png" alt="image-20220226204438666" style="zoom:50%;" />

<ul>
<li>编译文件</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo glib-compile-schemas /usr/share/glib-2.0/schemas</span><br></pre></td></tr></table></figure>

<p>完成以上步骤，正常来说就可以打开桌面共享的图标了。</p>
<img src="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220222141452790.png" alt="image-20220222141452790" width="500" />

<p>设置好后（不设置也可以）</p>
<img src="https://img-blog.csdnimg.cn/20200602124909227.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MzE4MTM1MA==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"  />

<ul>
<li>配置vnc设置</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ gsettings <span class="built_in">set</span> org.gnome.Vino prompt-enabled <span class="literal">false</span></span><br><span class="line">$ gsettings <span class="built_in">set</span> org.gnome.Vino require-encryption <span class="literal">false</span></span><br></pre></td></tr></table></figure>

<ul>
<li>设置密码（可以不要）</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ gsettings <span class="built_in">set</span> org.gnome.Vino authentication-methods <span class="string">&quot;[&quot;</span>vnc<span class="string">&quot;]&quot;</span></span><br><span class="line">$ gsettings <span class="built_in">set</span> org.gnome.Vino vnc-password $(<span class="built_in">echo</span> -n <span class="string">&quot;请输入你的密码&quot;</span>|<span class="built_in">base64</span>)</span><br></pre></td></tr></table></figure>



<ul>
<li>配置vnc自启</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">$ gsettings <span class="built_in">set</span> org.gnome.Vino enabled <span class="literal">true</span></span><br><span class="line">$ <span class="built_in">mkdir</span> -p ~/.config/autostart</span><br><span class="line">$ vi  ~/.config/autostart/vino-server.desktop</span><br></pre></td></tr></table></figure>

<p>添加下面内容</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">[Desktop Entry]</span><br><span class="line"></span><br><span class="line">Type=Application</span><br><span class="line"></span><br><span class="line">Name=Vino VNC server</span><br><span class="line"></span><br><span class="line">Exec=/usr/lib/vino/vino-server</span><br><span class="line"></span><br><span class="line">NoDisplay=<span class="literal">true</span></span><br></pre></td></tr></table></figure>

<ul>
<li><font color='red'>重启生效</font></li>
</ul>
 <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ sudo reboot</span><br></pre></td></tr></table></figure>



<ul>
<li><p>电脑端可下载<a target="_blank" rel="noopener" href="https://www.realvnc.com/en/connect/download/viewer/">Download VNC Viewer | VNC® Connect (realvnc.com)</a></p>
</li>
<li><img src="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220226204943881.png" alt="image-20220226204943881" style="zoom:33%;" />
</li>
<li><p>配置jetson nano的ip和密码即可连接</p>
</li>
<li><ul>
<li><p>遇到下图提示输入电脑账户魔密码即可（是你主机的密码，不是jetson的）</p>
<img src="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220302182808960.png" alt="image-20220302182808960" style="zoom:50%;" />

<img src="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220312224805927.png" alt="image-20220312224805927" width="500" /></li>
</ul>
</li>
</ul>
<h2 id="9-TensoRT"><a href="#9-TensoRT" class="headerlink" title="9. TensoRT"></a>9. TensoRT</h2><h3 id="9-1-TensoRT介绍："><a href="#9-1-TensoRT介绍：" class="headerlink" title="9.1. TensoRT介绍："></a>9.1. TensoRT介绍：</h3><p>​	模型加速越来越成为深度学习工程中的刚需了，最近的CVPR和ICLR会议中，模型的压缩和剪枝是受到的关注越来越多。毕竟工程上，算法工程师的深度学习模型是要在嵌入式平台跑起来，投入应用的。在模型的推理（inference）过程中，计算速度是很重要的。比如自动驾驶，如果使用一个经典的深度学习模型，很容易就跑到200毫秒的延时，那么这意味着，在实际驾驶过程中，你的车一秒钟只能看到5张图像，这当然是很危险的一件事。所以，对于实时响应比较高的任务，模型的加速时很有必要的一件事情了。</p>
<p>如果你使用英伟达的产品，比如PX2，那么在平台上部署模型投入应用，很多时候就需要用到专门的模型加速工具 —— TensorRT。</p>
<p><strong>TensorRT下的模型是在做什么？</strong></p>
<p>TensorRT只负责模型的推理（inference）过程，一般不用TensorRT来训练模型的哈。</p>
<p><strong>TensorRT能加速模型吗？</strong></p>
<p>能！根据官方文档，使用TensorRT，在CPU或者GPU模式下其可提供10X乃至100X的加速。本人的实际经验中，TensorRT提供了20X的加速。</p>
<p><strong>TensorRT为什么能提升模型的运行速度？</strong></p>
<p>TensorRT是英伟达针对自家平台做的加速包，TensorRT主要做了这么两件事情，来提升模型的运行速度。</p>
<ol>
<li>TensorRT支持INT8和FP16的计算。深度学习网络在训练时，通常使用 32 位或 16 位数据。TensorRT则在网络的推理时选用不这么高的精度，达到加速推断的目的。</li>
<li>TensorRT对于网络结构进行了重构，把一些能够合并的运算合并在了一起，针对GPU的特性做了优化。现在大多数深度学习框架是没有针对GPU做过性能优化的，而英伟达，GPU的生产者和搬运工，自然就推出了针对自己GPU的加速工具TensorRT。一个深度学习模型，在没有优化的情况下，比如一个卷积层、一个偏置层和一个reload层，这三层是需要调用三次cuDNN对应的API，但实际上这三层的实现完全是可以合并到一起的，TensorRT会对一些可以合并网络进行合并。</li>
</ol>
<img src="https://developer.nvidia.com/sites/default/files/akamai/deeplearning/tensorrt/trt-info.png" alt="img" style="zoom:50%;" />

<h3 id="9-2-检查自带TensorRT环境（选）"><a href="#9-2-检查自带TensorRT环境（选）" class="headerlink" title="9.2. 检查自带TensorRT环境（选）"></a>9.2. 检查自带TensorRT环境（选）</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cd</span> /usr/src/tensorrt/samples</span><br><span class="line">sudo make		<span class="comment">#编译大约7分钟</span></span><br><span class="line">../bin/sample_mnist</span><br></pre></td></tr></table></figure>

<img src="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220222141611316.png" alt="image-20220222141611316" width="300" />



<img src="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220312212555390.png" alt="image-20220312212555390" width="400" />

<h3 id="9-3-jetson-inference库安装（选）"><a href="#9-3-jetson-inference库安装（选）" class="headerlink" title="9.3. jetson inference库安装（选）"></a>9.3. <a target="_blank" rel="noopener" href="https://github.com/dusty-nv/jetson-inference">jetson inference</a>库安装（选）</h3><p><a target="_blank" rel="noopener" href="https://www.bilibili.com/read/cv13998685"> 参考资料 </a></p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">sudo apt update</span><br><span class="line">sudo apt autoremove</span><br><span class="line">sudo apt upgrade</span><br><span class="line">sudo apt install cmake</span><br><span class="line"><span class="built_in">mkdir</span> ~/workspace</span><br><span class="line"><span class="built_in">cd</span> workspace</span><br><span class="line">git <span class="built_in">clone</span> https://gitee.com/weikun-xuan/jetson-inference.git</span><br><span class="line"><span class="built_in">cd</span> jetson-inference</span><br><span class="line">git submodule update --init</span><br></pre></td></tr></table></figure>

<blockquote>
<p>start</p>
</blockquote>
<p>一、获取源码<br>首先打开终端运行如下代码：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">sudo apt-get update</span><br><span class="line"></span><br><span class="line">sudo apt-get install git cmake libpython3-dev python3-numpy</span><br><span class="line"></span><br><span class="line">git <span class="built_in">clone</span> --recursive https://gitee.com/weikun-xuan/jetson-inference.git</span><br></pre></td></tr></table></figure>


<p>上面仓库源我全都自己换了，下载会比GitHub快很多。</p>
<p>二、换源<br>进入到tools文件下：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cd</span> jetson-inference/tools</span><br><span class="line"></span><br></pre></td></tr></table></figure>


<p>换下源，依次运行以下代码（均在tools文件下）：</p>
<p>1）模型下载国内源：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ sed -in-place -e <span class="string">&#x27;s@https://nvidia.box.com/shared/static@https://bbs.gpuworld.cn/mirror@g&#x27;</span> download-models.sh</span><br></pre></td></tr></table></figure>

<p>2）pytorch国内源：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">$ sed -in-place -e <span class="string">&#x27;s@https://nvidia.box.com/shared/static@https://bbs.gpuworld.cn/mirror@g&#x27;</span> install-pytorch.sh</span><br><span class="line"></span><br><span class="line">$ sed -in-place -e <span class="string">&#x27;s@https://github.com/pytorch/vision@https://gitee.com/vcan123/pytorch@g&#x27;</span> install-pytorch.sh</span><br><span class="line"></span><br><span class="line">$ sed -in-place -e <span class="string">&#x27;s@https://github.com/dusty-nv/vision@https://gitee.com/vcan123/dusty-nv@g&#x27;</span> install-pytorch.sh</span><br></pre></td></tr></table></figure>


<p>三、编译安装</p>
<p>在jetson-infernce文件下执行如下操作：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">mkdir</span> build</span><br><span class="line"></span><br><span class="line"><span class="built_in">cd</span> build</span><br><span class="line"></span><br><span class="line">cmake ../</span><br></pre></td></tr></table></figure>


<p> 接着就会出现：</p>
<p>模型包安装</p>
<p> 此步为安装模型包，本人建议【全部取消】，不然会有些慢，之后我们可以去<a target="_blank" rel="noopener" href="https://github.com/dusty-nv/jetson-inference/releases">官网</a>手动下载。</p>
<p>我们继续：</p>
<p>pytorch安装</p>
<p> 安装pytorch。这时应该只有一个for python 3.6版本,选上然后ok。</p>
<p>完成后还是在build文件下依次执行如下操作：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">$ make</span><br><span class="line"></span><br><span class="line">$ sudo make install</span><br><span class="line"></span><br><span class="line">$ sudo ldconfig</span><br></pre></td></tr></table></figure>


<p>完成。</p>
<h2 id="10-安装jupyter和jetcam"><a href="#10-安装jupyter和jetcam" class="headerlink" title="10. 安装jupyter和jetcam"></a>10. 安装jupyter和jetcam</h2><ol>
<li><strong>安装nodejs和npm</strong></li>
</ol>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">pip3 install --upgrade pip	<span class="comment">#更新pip</span></span><br><span class="line">sudo apt install nodejs npm</span><br></pre></td></tr></table></figure>

<p>但是用直接用上面这个命令安装后的版本是比较低的后续要安装jupyterlab插件可能会报错，用一下版本可以查看,至少要12.3.0版本的node</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">node -v</span><br><span class="line">npm -v</span><br></pre></td></tr></table></figure>



<p>安装n模块，用这个模块来更新或者指定安装node的版本</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo npm install -g n</span><br></pre></td></tr></table></figure>

<p>先说明下这个模块的功能，一下命令了解下先，不用操作</p>
<p>清除npm缓存：npm cache clean -f</p>
<p>安装n模块：npm install -g n</p>
<p>安装官方稳定版本：n stable</p>
<p>安装最新官方版本：n latest</p>
<p>安装某个指定版本：n 11.6.0</p>
<p>查看已安装的node版本: n</p>
<p>查看当前node版本：node -v</p>
<p>删除指定版本：n rm 7.5.0</p>
<p>好的，了解完n模块的功能后来安装对应版本的node,也可以安装最新版的例如以下，</p>
<p>sudo n latest</p>
<p>安装好后，node -v 查看下版本，如果版本没有变，那么可以尝试重启下，如果还是没有变，执行</p>
<p>sudo n</p>
<p>会出现一个画面，可以看到我们安装过的node版本名，例如我们这里是v15.0.1，通过上下方向按键控制光标选择这个版本，然后回车镜像安装，然后查看下版本，如果还是没有变，一般再重启下就可以了。</p>
<ol start="2">
<li><strong>安装jupyterlab</strong>：（警告忽略，失败多次执行即可）</li>
</ol>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">sudo pip3 install jupyter jupyterlab</span><br><span class="line"></span><br><span class="line">sudo jupyter labextension install @jupyter-widgets/jupyterlab-manager</span><br><span class="line"></span><br><span class="line">sudo jupyter labextension install @jupyterlab/statusbar</span><br></pre></td></tr></table></figure>

<p>生成相应配置文件：（如果某个文件报权限问题，可以尝试用sudo chmod 777赋予权限）</p>
<p>jupyter lab –generate-config</p>
<p>设置进入notebook的密码（这里会要设置两次，第二次为确认输入的密码）：</p>
<p>jupyter notebook password</p>
<p>当第一次登录使用notebook时需要输入你在这里设置的密码才能进入，请务必记住的当前设置的密码！</p>
<p>设置开机自启动jupterlab，create_jupyter_service.py文件</p>
<p>运行create_jupyter_service.py文件产生jupyter_service.service文件</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">python3 create_jupyter_service.py</span><br></pre></td></tr></table></figure>

<p>然后将产生的该服务文件移动至系统服务</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo <span class="built_in">mv</span> nano_jupyter.service /etc/systemd/system/nano_jupyter.service</span><br></pre></td></tr></table></figure>

<p>使能该服务</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo systemctl <span class="built_in">enable</span> nano_jupyter.service</span><br></pre></td></tr></table></figure>

<p>手动开启该服务</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo systemctl start nano_jupyter.service</span><br></pre></td></tr></table></figure>



<ol start="3">
<li><strong>安装jetcam</strong></li>
</ol>
<p>JetCam是用于NVIDIA Jetson的易于使用的Python相机界面。使用Jetson的<a target="_blank" rel="noopener" href="https://developer.download.nvidia.com/embedded/L4T/r32_Release_v1.0/Docs/Accelerated_GStreamer_User_Guide.pdf?uIzwdFeQNE8N-vV776ZCUUEbiJxYagieFEqUoYFM9XSf9tbslxWqFKnVHu8erbZZS20A7ADAIgmSQJvXZTb0LkuGl9GoD5HJz4263HcmYWZW0t2OeFSJKZOfuWZ-lF51Pva2DSDtu2QPs-junm7BhMB_9AMQRwExuDb5zIhf_o8PIbA4KKo">Accelerated GStreamer插件可</a>与各种USB和CSI摄像机配合使用。轻松读取图像作为numpy数组image &#x3D; camera.read()。设置相机以running &#x3D; True将回调附加到新框架。JetCam使在Python中创建AI项目的原型变得容易，尤其是在<a target="_blank" rel="noopener" href="http://github.com/NVIDIA-AI-IOT/jetcard">JetCard中</a>安装的Jupyter Lab编程环境中。</p>
<p>接下来开始安装:</p>
<p>git clone <a target="_blank" rel="noopener" href="https://github.com/NVIDIA-AI-IOT/jetcam">https://github.com/NVIDIA-AI-IOT/jetcam</a></p>
<p>cd jetcam</p>
<p>sudo python3 setup.py install</p>
<p>详细的使用即函数可以到<a target="_blank" rel="noopener" href="https://github.com/NVIDIA-AI-IOT/jetcam%E6%9F%A5%E7%9C%8B">https://github.com/NVIDIA-AI-IOT/jetcam查看</a></p>
<h2 id="11-darknet框架（选）"><a href="#11-darknet框架（选）" class="headerlink" title="11. darknet框架（选）"></a>11. darknet框架（选）</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git <span class="built_in">clone</span> https://github.com/AlexeyAB/darknet.git <span class="comment">#下载darknet框架</span></span><br></pre></td></tr></table></figure>

<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">$ <span class="built_in">cd</span> darknet</span><br><span class="line"></span><br><span class="line">$ sudo vim Makefile   <span class="comment">#修改Makefile</span></span><br></pre></td></tr></table></figure>

<ul>
<li>将<code>Makefile</code>的前三行修改一下</li>
</ul>
<img src="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220222141647174.png" alt="image-20220222141647174" width="300" />

<ul>
<li>和如图所示的nvcc位置（若前面配置了环境变量则无需这一步操作）</li>
</ul>
<img src="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220222141654527.png" alt="image-20220222141654527" width="500" />

<ul>
<li><p>修改好猴按<code>esc</code>左下角出现冒号后<code>wq</code>保存退出</p>
</li>
<li><p>在darknet路径下编译</p>
</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ make -j4</span><br></pre></td></tr></table></figure>

<p>编译完成如图</p>
<img src="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220224143750683.png" alt="image-20220224143750683" width='2000' style="zoom:25%;" />

<p>在命令行下输入  <code>./darknet</code></p>
<img src="https://yqypicbed.oss-cn-hangzhou.aliyuncs.com/typoraoss/image-20220224143905042.png" alt="image-20220224143905042"  style="zoom:50%;" />

<p>在yolo官网下载yolov4和yolov4-tiny的权重文件放入文件夹</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#Yolov4图片的检测</span></span><br><span class="line">./darknet detect cfg/yolov4.cfg yolov4.weights data/dog.jpg <span class="comment"># 简写版</span></span><br><span class="line"></span><br><span class="line">./darknet detector <span class="built_in">test</span> cfg/coco.data cfg/yolov4.cfg yolov4.weights data/dog.jpg <span class="comment"># 完整版</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">#Yolov4-tiny图片的检测</span></span><br><span class="line">./darknet detect cfg/yolov4-tiny.cfg yolov4-tiny.weights data/dog.jpg <span class="comment"># 简写版</span></span><br><span class="line"></span><br><span class="line">./darknet detector <span class="built_in">test</span> cfg/coco.data cfg/yolov4-tiny.cfg yolov4-tiny.weights data/dog.jpg <span class="comment"># 完整版</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment"># 改变检测阈值</span></span><br><span class="line"><span class="comment"># 默认情况下，YOLO仅显示检测到的置信度为.25或更高的对象。您可以通过将-thresh标志传递给yolo命令来更改此设置。</span></span><br><span class="line"></span><br><span class="line"><span class="comment">#例如，要显示所有检测，您可以将阈值设置为0.1：</span></span><br><span class="line">./darknet detect cfg/yolov4-tiny.cfg yolov4-tiny.weights data/dog.jpg -thresh 0.1</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#Yolov4摄像头实时检测方法：</span></span><br><span class="line">./darknet detector demo cfg/coco.data cfg/yolov4.cfg yolov4.weights /dev/video1</span><br><span class="line"></span><br><span class="line"><span class="comment">#Yolov4-tiny摄像头实时检测方法：</span></span><br><span class="line">./darknet detector demo cfg/coco.data cfg/yolov4-tiny.cfg yolov4-tiny.weights /dev/video1</span><br><span class="line"></span><br></pre></td></tr></table></figure>



<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#Yolov4视频的检测(github下来的data里面并没有该视频文件，需要用户自行上传要检测的视频文件到data文件夹下)</span></span><br><span class="line">./darknet detector demo cfg/coco.data cfg/yolov4.cfg yolov4.weights data/123.mp4</span><br><span class="line"></span><br><span class="line"><span class="comment">#Yolov4-tiny视频的检测</span></span><br><span class="line"><span class="comment">#Yolov4-tiny视频的检测(github下来的data里面并没有该视频文件，需要用户自行上传要检测的视频文件到data文件夹下)</span></span><br><span class="line"></span><br><span class="line">./darknet detector demo cfg/coco.data cfg/yolov4-tiny.cfg yolov4-tiny.weights data/xxx.mp4</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<ul>
<li>若要调用csi摄像头需要gstream的支持</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">./darknet detector demo cfg/coco.data cfg/yolov4-tiny.cfg yolov4-tiny.weights <span class="string">&quot;nvarguscamerasrc ! video/x-raw(memory:NVMM), width=1280, height=720, format=NV12, framerate=30/1 ! nvvidconv  ! video/x-raw, width=1280, height=720, format=BGRx ! videoconvert ! video/x-raw, format=BGR ! appsink&quot;</span></span><br><span class="line"></span><br></pre></td></tr></table></figure>



<p><a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_44360908/article/details/122777848"> 解决Jetson Nano使用CSI摄像头在Darknet下实时检测绿屏_</a></p>
<h1 id="Nvidia-Jetson-Nano-安装-GStreamer"><a href="#Nvidia-Jetson-Nano-安装-GStreamer" class="headerlink" title="Nvidia Jetson Nano 安装 GStreamer"></a>Nvidia Jetson Nano 安装 GStreamer</h1><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">sudo add-apt-repository universe</span><br><span class="line">sudo add-apt-repository multiverse</span><br><span class="line">sudo apt-get update</span><br><span class="line">sudo apt-get install gstreamer1.0-tools gstreamer1.0-alsa gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav</span><br><span class="line">sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev libgstreamer-plugins-bad1.0-dev</span><br></pre></td></tr></table></figure>



<h2 id="1-配置GStreamer管道"><a href="#1-配置GStreamer管道" class="headerlink" title="1. 配置GStreamer管道"></a>1. 配置GStreamer管道</h2><p>首先说一下思路：由于yolov3本身不支持csi摄像头，因此需要通过GStreamer来对csi摄像头获取的视频进行预处理，然后提交给yolov3进行识别判定，而这一过程重点就是GStreamer管道的配置，以下是博主的管道配置</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 仅适用于jetson-nano运行yolov4-tiny demo。注意请在darknet的文档页下打开terminal输入</span></span><br><span class="line"></span><br><span class="line">./darknet detector demo cfg/coco.data cfg/yolov4-tiny.cfg yolov4-tiny.weights <span class="string">&quot;nvarguscamerasrc ! video/x-raw(memory:NVMM), width=1280, height=720, format=NV12, framerate=30/1 ! nvvidconv flip-method=2 ! video/x-raw, width=1280, height=720, format=BGRx ! videoconvert ! video/x-raw, format=BGR ! appsink&quot;</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">./darknet detector demo cfg/coco.data cfg/yolov4-tiny.cfg yolov4-tiny.weights <span class="string">&quot;nvarguscamerasrc ! video/x-raw(memory:NVMM), width=1280, height=720, format=NV12, framerate=30/1 ! nvvidconv flip-method=2 ! video/x-raw, width=1280, height=720, format=BGRx ! videoconvert ! video/x-raw, format=BGR ! appsink&quot;</span></span><br><span class="line"></span><br></pre></td></tr></table></figure>





<p>原版：</p>
<p>.&#x2F;darknet detector demo ok&#x2F;new.data ok&#x2F;yolov4-tiny-new.cfg ok&#x2F;yolov4-tiny-new_last.weights “nvarguscamerasrc ! video&#x2F;x-raw(memory:NVMM), width&#x3D;1280, height&#x3D;720, format&#x3D;NV12, framerate&#x3D;30&#x2F;1 ! nvvidconv flip-method&#x3D;2 ! video&#x2F;x-raw, width&#x3D;1280, height&#x3D;720, format&#x3D;BGRx ! videoconvert ! video&#x2F;x-raw, format&#x3D;BGR ! appsink”</p>
<p>口罩</p>
<p>.&#x2F;darknet detector demo cfg&#x2F;obj.data cfg&#x2F;yolov4-tiny-masks.cfg yolov4-tiny-obj_last.weights “nvarguscamerasrc ! video&#x2F;x-raw(memory:NVMM), width&#x3D;1280, height&#x3D;720, format&#x3D;NV12, framerate&#x3D;30&#x2F;1 ! nvvidconv flip-method&#x3D;2 ! video&#x2F;x-raw, width&#x3D;1280, height&#x3D;720, format&#x3D;BGRx ! videoconvert ! video&#x2F;x-raw, format&#x3D;BGR ! appsink”</p>
<p>yolo:</p>
<p>.&#x2F;darknet detector demo cfg&#x2F;coco.data cfg&#x2F;yolov4-tiny.cfg yolov4-tiny.weights “nvarguscamerasrc ! video&#x2F;x-raw(memory:NVMM), width&#x3D;1280, height&#x3D;720, format&#x3D;NV12, framerate&#x3D;30&#x2F;1 ! nvvidconv flip-method&#x3D;2 ! video&#x2F;x-raw, width&#x3D;1280, height&#x3D;720, format&#x3D;BGRx ! videoconvert ! video&#x2F;x-raw, format&#x3D;BGR ! appsink”</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">sudo add-apt-repository universe</span><br><span class="line">sudo add-apt-repository multiverse</span><br><span class="line">sudo apt-get update</span><br><span class="line">sudo apt-get install gstreamer1.0-tools gstreamer1.0-alsa gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav</span><br><span class="line">sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev libgstreamer-plugins-bad1.0-dev</span><br></pre></td></tr></table></figure>

<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">官方：</span><br><span class="line">./darknet detector demo ok/new.data ok/yolov4-tiny-new.cfg ok/yolov4-tiny-new_last.weights <span class="string">&quot;nvarguscamerasrc ! video/x-raw(memory:NVMM), width=1280, height=720, format=NV12, framerate=30/1 ! nvvidconv flip-method=2 ! video/x-raw, width=1280, height=720, format=BGRx ! videoconvert ! video/x-raw, format=BGR ! appsink&quot;</span></span><br><span class="line"></span><br><span class="line">// 仅适用于jetson-nano运行yolov3-tiny demo。注意请在darknet的文档页下打开terminal输入</span><br><span class="line">./darknet detector demo cfg/coco.data cfg/yolov4-tiny.cfg yolov4-tiny.weights <span class="string">&quot;nvarguscamerasrc ! video/x-raw(memory:NVMM), width=1280, height=720, format=NV12, framerate=30/1 ! nvvidconv flip-method=2 ! video/x-raw, width=1280, height=720, format=BGRx ! videoconvert ! video/x-raw, format=BGR ! appsink&quot;</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">./darknet detector demo cfg/coco.data cfg/yolov4-tiny.cfg yolov4-tiny.weights <span class="string">&quot;nvarguscamerasrc ! video/x-raw(memory:NVMM), width=1280, height=720, format=NV12, framerate=30/1 ! nvvidconv flip-method=2 ! video/x-raw, width=1280, height=720, format=BGRx ! videoconvert ! video/x-raw, format=BGR ! appsink&quot;</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">./darknet detector demo cfg/coco.data cfg/yolov4-tiny.cfg yolov4-tiny.weights <span class="string">&quot;nvarguscamerasrc ! video/x-raw(memory:NVMM), width=1280, height=720, format=NV12, framerate=30/1 ! nvvidconv flip-method=2 ! video/x-raw, width=1280, height=720, format=BGRx ! videoconvert ! video/x-raw, format=BGR ! appsink&quot;</span></span><br></pre></td></tr></table></figure>






      
    </div>
    <div class="article-footer">
      <blockquote class="mt-2x">
  <ul class="post-copyright list-unstyled">
    
    <li class="post-copyright-link hidden-xs">
      <strong>本文链接：</strong>
      <a href="https://gitee.com/yin-qiyu/myblog/2022/02/11/learn_jetson/1.Environment%20configuration/" title="基础环境配置" target="_blank" rel="external">https://gitee.com/yin-qiyu/myblog/2022/02/11/learn_jetson/1.Environment configuration/</a>
    </li>
    
    <li class="post-copyright-license">
      <strong>版权声明： </strong> 本博客所有文章除特别声明外，均采用 <a href="http://creativecommons.org/licenses/by/4.0/deed.zh" target="_blank" rel="external">CC BY 4.0 CN协议</a> 许可协议。转载请注明出处！
    </li>
  </ul>
</blockquote>


<div class="panel panel-default panel-badger">
  <div class="panel-body">
    <figure class="media">
      <div class="media-left">
        <a href="https://github.com/cofess" target="_blank" class="img-burn thumb-sm visible-lg">
          <img src="/yin-qiyu/myblog/images/avatar.jpg" class="img-rounded w-full" alt="">
        </a>
      </div>
      <div class="media-body">
        <h3 class="media-heading"><a href="https://github.com/cofess" target="_blank"><span class="text-dark">昵称</span><small class="ml-1x">Web Developer &amp; Designer</small></a></h3>
        <div>个人简介。</div>
      </div>
    </figure>
  </div>
</div>


    </div>
  </article>
  
    
  <section id="comments">
  	
      <div id="vcomments"></div>
    
  </section>


  
</div>

  <nav class="bar bar-footer clearfix" data-stick-bottom>
  <div class="bar-inner">
  
  <ul class="pager pull-left">
    
    <li class="prev">
      <a href="/yin-qiyu/myblog/2022/02/17/learn_jetson/README/" title="(no title)"><i class="icon icon-angle-left" aria-hidden="true"></i><span>&nbsp;&nbsp;Newer</span></a>
    </li>
    
    
    <li class="next">
      <a href="/yin-qiyu/myblog/2022/02/11/learn_jetson/docker/" title="(no title)"><span>Older&nbsp;&nbsp;</span><i class="icon icon-angle-right" aria-hidden="true"></i></a>
    </li>
    
    
  </ul>
  
  
  <!-- Button trigger modal -->
  <button type="button" class="btn btn-fancy btn-donate pop-onhover bg-gradient-warning" data-toggle="modal" data-target="#donateModal"><span>$</span></button>
  <!-- <div class="wave-icon wave-icon-danger btn-donate" data-toggle="modal" data-target="#donateModal">
    <div class="wave-circle"><span class="icon"><i class="icon icon-bill"></i></span></div>
  </div> -->
  
  
  <div class="bar-right">
    
    <div class="share-component" data-sites="weibo,qq,wechat,facebook,twitter" data-mobile-sites="weibo,qq,qzone"></div>
    
  </div>
  </div>
</nav>
  
<!-- Modal -->
<div class="modal modal-center modal-small modal-xs-full fade" id="donateModal" tabindex="-1" role="dialog">
  <div class="modal-dialog" role="document">
    <div class="modal-content donate">
      <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
      <div class="modal-body">
        <div class="donate-box">
          <div class="donate-head">
            <p>Maybe you could buy me a cup of coffee.</p>
          </div>
          <div class="tab-content">
            <div role="tabpanel" class="tab-pane fade active in" id="alipay">
              <div class="donate-payimg">
                <img src="/yin-qiyu/myblog/images/donate/alipayimg.png" alt="Scan Qrcode" title="Scan" />
              </div>
              <p class="text-muted mv">Scan this qrcode</p>
              <p class="text-grey">Open alipay app scan this qrcode, buy me a coffee!</p>
            </div>
            <div role="tabpanel" class="tab-pane fade" id="wechatpay">
              <div class="donate-payimg">
                <img src="/yin-qiyu/myblog/images/donate/wechatpayimg.png" alt="Scan Qrcode" title="Scan" />
              </div>
              <p class="text-muted mv">Scan this qrcode</p>
              <p class="text-grey">Open wechat app scan this qrcode, buy me a coffee!</p>
            </div>
          </div>
          <div class="donate-footer">
            <ul class="nav nav-tabs nav-justified" role="tablist">
              <li role="presentation" class="active">
                <a href="#alipay" id="alipay-tab" role="tab" data-toggle="tab" aria-controls="alipay" aria-expanded="true"><i class="icon icon-alipay"></i> alipay</a>
              </li>
              <li role="presentation" class="">
                <a href="#wechatpay" role="tab" id="wechatpay-tab" data-toggle="tab" aria-controls="wechatpay" aria-expanded="false"><i class="icon icon-wepay"></i> wechat payment</a>
              </li>
            </ul>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>



</main>

  <footer class="footer" itemscope itemtype="http://schema.org/WPFooter">
	
	
    <ul class="social-links">
    	
        <li><a href="https://github.com/cofess" target="_blank" title="Github" data-toggle=tooltip data-placement=top><i class="icon icon-github"></i></a></li>
        
        <li><a href="http://weibo.com/cofess" target="_blank" title="Weibo" data-toggle=tooltip data-placement=top><i class="icon icon-weibo"></i></a></li>
        
        <li><a href="https://twitter.com/iwebued" target="_blank" title="Twitter" data-toggle=tooltip data-placement=top><i class="icon icon-twitter"></i></a></li>
        
        <li><a href="https://www.behance.net/cofess" target="_blank" title="Behance" data-toggle=tooltip data-placement=top><i class="icon icon-behance"></i></a></li>
        
        <li><a href="/yin-qiyu/myblog/atom.xml" target="_blank" title="Rss" data-toggle=tooltip data-placement=top><i class="icon icon-rss"></i></a></li>
        
    </ul>

    <div class="copyright">
    	
        <div class="publishby">
        	Theme by <a href="https://github.com/cofess" target="_blank"> cofess </a>base on <a href="https://github.com/cofess/hexo-theme-pure" target="_blank">pure</a>.
        </div>
    </div>
</footer>
  <script src="//cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
<script>
window.jQuery || document.write('<script src="js/jquery.min.js"><\/script>')
</script>

<script src="/yin-qiyu/myblog/js/plugin.min.js"></script>


<script src="/yin-qiyu/myblog/js/application.js"></script>


    <script>
(function (window) {
    var INSIGHT_CONFIG = {
        TRANSLATION: {
            POSTS: 'Posts',
            PAGES: 'Pages',
            CATEGORIES: 'Categories',
            TAGS: 'Tags',
            UNTITLED: '(Untitled)',
        },
        ROOT_URL: '/yin-qiyu/myblog/',
        CONTENT_URL: '/yin-qiyu/myblog/content.json',
    };
    window.INSIGHT_CONFIG = INSIGHT_CONFIG;
})(window);
</script>

<script src="/yin-qiyu/myblog/js/insight.js"></script>






   




   
    
  <script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/valine"></script>
  <script type="text/javascript">
  var GUEST = ['nick', 'mail', 'link'];
  var meta = 'nick,mail,link';
  meta = meta.split(',').filter(function(item) {
    return GUEST.indexOf(item) > -1;
  });
  new Valine({
    el: '#vcomments',
    verify: false,
    notify: false,
    appId: '',
    appKey: '',
    placeholder: 'Just go go',
    avatar: 'mm',
    meta: meta,
    pageSize: '10' || 10,
    visitor: false
  });
  </script>

     







</body>
</html>